/*
 * AHRS.h
 *
 *  Created on: 2013-2-12
 *      Author: Miles
 */

#ifndef AHRS_H_
#define AHRS_H_
#include "C6747.h"

void AHRS_Generate_Cbr2qdot(double *ahrs_xk_pre, double *C_brate2qdot);
void AHRS_Generate_xdot(double *C_brate2qdot,double *gyro_data, double *xdot);
void AHRS_Generate_Fk(double *ahrs_xk_pre,double *gyro_data,double ts, double *Fk);
void AHRS_Generate_Qk(double *ahrs_xk_pre,double ts, double *Qk);
void AHRS_Generate_Hk(double *ahrs_xk_tp, double *Hk,double *hk);
Uint8 AHRS_INIT(double *gyro_bias, double *init_att);
void AHRS_FUN(double ts, double *ahrs_xk_pre, double *ahrs_gyro_bias, double *Pk_pre,  double *ahrs_xk, double *Pk, double *att_est);
//ahrs_xk_pre - status at last epoch; gyro_data - new measured gyro value; ahrs_gyro_bias - variable for gyro_bias accumulation;
//ahrs_xk - status at now epoch
//Rk and Qk are dynamic and decided in this function

#endif /* AHRS_H_ */
